GtkBookmarksManager: Only save if we have data to save
authorColin Walters <walters@verbum.org>
Thu, 9 May 2013 20:48:38 +0000 (16:48 -0400)
committerColin Walters <walters@verbum.org>
Thu, 9 May 2013 20:48:38 +0000 (16:48 -0400)
Otherwise we write an empty file, which is lame.

gtk/gtkbookmarksmanager.c

index e475ea0756b3f831c7d7164953c2941a7422aef9..c7eb0263370ce943e00a1474b0375e9fcf115fec 100644 (file)
@@ -221,7 +221,8 @@ _gtk_bookmarks_manager_new (GtkBookmarksChangedFunc changed_func, gpointer chang
       /* Read the legacy one and write it to the new one */
       legacy_bookmarks_file = get_legacy_bookmarks_file ();
       manager->bookmarks = read_bookmarks (legacy_bookmarks_file);
-      save_bookmarks (bookmarks_file, manager->bookmarks);
+      if (manager->bookmarks)
+       save_bookmarks (bookmarks_file, manager->bookmarks);
 
       g_object_unref (legacy_bookmarks_file);
     }